﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using DataMining.Properties;

namespace DataMining.DataAccess
{
    public  class DBConnection
    {
        private  SqlConnection sqlConnection1 = null;

        /// <summary>
        /// 数据源数据库
        /// </summary>
        /// <param name="conn"></param>
        /// <returns></returns>
        public  SqlConnection getSqlConnection1()
        {
            if (sqlConnection1 == null)
            {
                Settings setting = new Settings();
                sqlConnection1 = new SqlConnection();
                //sqlConnection.ConnectionString = "Data Source=ERPLAB-E2BCCC62;Initial Catalog=hospital;User ID=erplab;Password=erplab";
                //sqlConnection.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=hospital;Integrated Security=True";
                //sqlConnection.ConnectionString = "Data Source=PC-200903311632;Initial Catalog=hospitalTest;Integrated Security=True";
               // sqlConnection1.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=DataCenter;Integrated Security=True";
               // sqlConnection1.ConnectionString = "Data Source=192.168.0.250;Initial Catalog=TEST0;User ID=erplab;Password=erplab";
               //sqlConnection1.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=DataCenter;User ID=sa;Password=sa";
                sqlConnection1.ConnectionString = "Data Source=PC-200909251312;Initial Catalog=DataCenter;User ID=sa;Password=sa";
                // sqlConnection1.ConnectionString = "Data Source=ADMIN-PC;Initial Catalog=DataWareHouseTest;User ID=sa;Password=sa";                        
                return sqlConnection1;
            }
            else
                return sqlConnection1;
        }

        public void Dispose()
        {
            if (sqlConnection1 != null)
                sqlConnection1.Dispose();
        }
    }
}
